<?php
include_once 'controller/default.php';
include_once 'connection/connection_database.php';

class hotline {

    function Insert($hotline) {
        $sql = "INSERT INTO hotline(hotline_phone)"; 
        $sql .= "VALUES('{$hotline["hotline_phone"]}')";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function Delete($hotline) {
        $sql = "DELETE FROM hotline WHERE hotline_id='{$hotline["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function Update($hotline) {
        $sql = "UPDATE hotline SET hotline_phone='{$hotline["hotline_phone"]}' WHERE hotline_id='{$hotline["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function FillAll() {
        $sql = "SELECT * FROM hotline";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function FillOne($hotline) {
        $sql = "SELECT * FROM hotline WHERE hotline_id='{$hotline["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return mysql_fetch_array($result);
    }

}

?>
